<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>FLITr: flitr::SharedImageBuffer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">FLITr
   &#160;<span id="projectnumber">1.x</span>
   </div>
   <div id="projectbrief">Framework for Live Image Transformation.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classflitr_1_1_shared_image_buffer.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classflitr_1_1_shared_image_buffer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">flitr::SharedImageBuffer Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Class for passing images between producers and consumers.  
 <a href="classflitr_1_1_shared_image_buffer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="shared__image__buffer_8h_source.html">shared_image_buffer.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for flitr::SharedImageBuffer:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer__coll__graph.png" border="0" usemap="#flitr_1_1_shared_image_buffer_coll__map" alt="Collaboration graph"/></div>
<map name="flitr_1_1_shared_image_buffer_coll__map" id="flitr_1_1_shared_image_buffer_coll__map">
<area shape="rect" id="node2" href="classflitr_1_1_image_producer.html" title="{flitr::ImageProducer\n|# ImageFormat_\l# SharedImageBuffer_\l# CreateMetadataFunction_\l|+ ImageProducer()\l+ ~ImageProducer()\l+ init()\l+ getFormat()\l+ getNumWriteSlotsAvailable()\l+ trigger()\l+ seek()\l+ getLeastNumReadSlotsAvailable()\l+ setCreateMetadataFunction()\l# releaseReadSlotCallback()\l# addConsumer()\l# reserveWriteSlot()\l# releaseWriteSlot()\l}" alt="" coords="5,5,240,333"/></map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7b39011592f16e276f0095fa2e29e24e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a7b39011592f16e276f0095fa2e29e24e">SharedImageBuffer</a> (<a class="el" href="classflitr_1_1_image_producer.html">ImageProducer</a> &amp;my_producer, uint32_t num_slots, uint32_t images_per_slot)</td></tr>
<tr class="memitem:a49353cc6a70e400e0c5a2416797e5cde"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a49353cc6a70e400e0c5a2416797e5cde">~SharedImageBuffer</a> ()</td></tr>
<tr class="memitem:aba6c3ad90a690a4b8228d844777a30cb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#aba6c3ad90a690a4b8228d844777a30cb">initWithStorage</a> ()</td></tr>
<tr class="memitem:aa37421f69f9cfa2aff6d656ad7ba0872"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#aa37421f69f9cfa2aff6d656ad7ba0872">initWithoutStorage</a> ()</td></tr>
<tr class="memitem:a0b7aa2db43f866dd0f24563869a31546"><td class="memItemLeft" align="right" valign="top">virtual uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a0b7aa2db43f866dd0f24563869a31546">getNumWriteSlotsAvailable</a> () const </td></tr>
<tr class="memitem:aba78dc0f1a7c2db27351d5d3da7b69b1"><td class="memItemLeft" align="right" valign="top">virtual std::vector&lt; <a class="el" href="classflitr_1_1_image.html">Image</a> ** &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#aba78dc0f1a7c2db27351d5d3da7b69b1">reserveWriteSlot</a> ()</td></tr>
<tr class="memitem:a19244a4980ad7ae90bc173cce849c001"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a19244a4980ad7ae90bc173cce849c001">releaseWriteSlot</a> ()</td></tr>
<tr class="memitem:a5bed33931d9fd306361f38f8b8827f2b"><td class="memItemLeft" align="right" valign="top">virtual uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a5bed33931d9fd306361f38f8b8827f2b">getLeastNumReadSlotsAvailable</a> ()</td></tr>
<tr class="memitem:a05fecee04bca209e211d036e493a311c"><td class="memItemLeft" align="right" valign="top">virtual uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a05fecee04bca209e211d036e493a311c">getNumReadSlotsAvailable</a> (const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;consumer)</td></tr>
<tr class="memitem:ad3d4705f97f0fb770cc6f75bb90eb27a"><td class="memItemLeft" align="right" valign="top">virtual uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#ad3d4705f97f0fb770cc6f75bb90eb27a">getNumReadSlotsReserved</a> (const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;consumer)</td></tr>
<tr class="memitem:af51a55ce88130bbb3ba523836fe8b24f"><td class="memItemLeft" align="right" valign="top">virtual std::vector&lt; <a class="el" href="classflitr_1_1_image.html">Image</a> ** &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#af51a55ce88130bbb3ba523836fe8b24f">reserveReadSlot</a> (const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;consumer)</td></tr>
<tr class="memitem:a7ba7642014e9d00d4529e0c2da41d817"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a7ba7642014e9d00d4529e0c2da41d817">releaseReadSlot</a> (const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;consumer)</td></tr>
<tr class="memitem:a8afe882347c328271b6314403bf158dd"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a8afe882347c328271b6314403bf158dd">addConsumer</a> (<a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;consumer)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:a72664737877581da89cda45bbf07956a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a72664737877581da89cda45bbf07956a">isFull</a> () const </td></tr>
<tr class="memdesc:a72664737877581da89cda45bbf07956a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if there is no more space in the buffer for writing.  <a href="#a72664737877581da89cda45bbf07956a"></a><br/></td></tr>
<tr class="memitem:a786218cf02230d38313d7afd7d40155f"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a786218cf02230d38313d7afd7d40155f">getFill</a> () const </td></tr>
<tr class="memdesc:a786218cf02230d38313d7afd7d40155f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the space 'filled' in the buffer.  <a href="#a786218cf02230d38313d7afd7d40155f"></a><br/></td></tr>
<tr class="memitem:afeaf4dc55a613e16c992947fd5e23e4f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#afeaf4dc55a613e16c992947fd5e23e4f">tailPopped</a> (const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;consumer)</td></tr>
<tr class="memitem:a31fd2907c728e5d5c76de8f116a9b3bc"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a31fd2907c728e5d5c76de8f116a9b3bc">numAvailable</a> (const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;consumer)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a275b68995a2927046b745c581131f4a5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflitr_1_1_image_producer.html">ImageProducer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a275b68995a2927046b745c581131f4a5">ImageProducer_</a></td></tr>
<tr class="memdesc:a275b68995a2927046b745c581131f4a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The producer we are a member of.  <a href="#a275b68995a2927046b745c581131f4a5"></a><br/></td></tr>
<tr class="memitem:ad20334fc4ef275986c4e67be4e662ac1"><td class="memItemLeft" align="right" valign="top">OpenThreads::Mutex&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#ad20334fc4ef275986c4e67be4e662ac1">BufferMutex_</a></td></tr>
<tr class="memdesc:ad20334fc4ef275986c4e67be4e662ac1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Protects read and write positions.  <a href="#ad20334fc4ef275986c4e67be4e662ac1"></a><br/></td></tr>
<tr class="memitem:aed412326e79260b65385ee085682d9c8"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#aed412326e79260b65385ee085682d9c8">NumSlots_</a></td></tr>
<tr class="memdesc:aed412326e79260b65385ee085682d9c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of slots in the buffer.  <a href="#aed412326e79260b65385ee085682d9c8"></a><br/></td></tr>
<tr class="memitem:a7ea53da89e210b91832f1b36bb3c368b"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a7ea53da89e210b91832f1b36bb3c368b">ImagesPerSlot_</a></td></tr>
<tr class="memdesc:a7ea53da89e210b91832f1b36bb3c368b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of images in each slot of the buffer.  <a href="#a7ea53da89e210b91832f1b36bb3c368b"></a><br/></td></tr>
<tr class="memitem:a00bf09efefa475ac09b8f57585f44d04"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a00bf09efefa475ac09b8f57585f44d04">WriteTail_</a></td></tr>
<tr class="memdesc:a00bf09efefa475ac09b8f57585f44d04"><td class="mdescLeft">&#160;</td><td class="mdescRight">One past where we have already written.  <a href="#a00bf09efefa475ac09b8f57585f44d04"></a><br/></td></tr>
<tr class="memitem:ae50f18394ddc6e071a0680181a0051d9"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#ae50f18394ddc6e071a0680181a0051d9">WriteHead_</a></td></tr>
<tr class="memdesc:ae50f18394ddc6e071a0680181a0051d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Point where we are about to write.  <a href="#ae50f18394ddc6e071a0680181a0051d9"></a><br/></td></tr>
<tr class="memitem:a3451b7400d02e765fffb3421141360c8"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a3451b7400d02e765fffb3421141360c8">NumWriteReserved_</a></td></tr>
<tr class="memdesc:a3451b7400d02e765fffb3421141360c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">How many slots have been reserved for writing.  <a href="#a3451b7400d02e765fffb3421141360c8"></a><br/></td></tr>
<tr class="memitem:a96f00d00633744cab0134509217be32e"><td class="memItemLeft" align="right" valign="top">std::map&lt; const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> <br class="typebreak"/>
*, uint32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a96f00d00633744cab0134509217be32e">ReadTails_</a></td></tr>
<tr class="memdesc:a96f00d00633744cab0134509217be32e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map of consumers to one past where they have completed reading.  <a href="#a96f00d00633744cab0134509217be32e"></a><br/></td></tr>
<tr class="memitem:a1293e90f99e0414ae04baab938532eb5"><td class="memItemLeft" align="right" valign="top">std::map&lt; const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> <br class="typebreak"/>
*, uint32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a1293e90f99e0414ae04baab938532eb5">ReadHeads_</a></td></tr>
<tr class="memdesc:a1293e90f99e0414ae04baab938532eb5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map of consumers to where they are about to read.  <a href="#a1293e90f99e0414ae04baab938532eb5"></a><br/></td></tr>
<tr class="memitem:a42642938824de5506c0705f73afbfce2"><td class="memItemLeft" align="right" valign="top">std::map&lt; const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> <br class="typebreak"/>
*, uint32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a42642938824de5506c0705f73afbfce2">NumReadReserved_</a></td></tr>
<tr class="memdesc:a42642938824de5506c0705f73afbfce2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map of consumers to the number of read slots reserved.  <a href="#a42642938824de5506c0705f73afbfce2"></a><br/></td></tr>
<tr class="memitem:a5d6eda5c6b72893dcd44a07f6be46814"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector<br class="typebreak"/>
&lt; <a class="el" href="classflitr_1_1_image.html">Image</a> * &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a5d6eda5c6b72893dcd44a07f6be46814">Buffer_</a></td></tr>
<tr class="memdesc:a5d6eda5c6b72893dcd44a07f6be46814"><td class="mdescLeft">&#160;</td><td class="mdescRight">The actual ring buffer. Contains only pointers.  <a href="#a5d6eda5c6b72893dcd44a07f6be46814"></a><br/></td></tr>
<tr class="memitem:a4cf42f427a3eac7b1d0c8974b074a550"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflitr_1_1_shared_image_buffer.html#a4cf42f427a3eac7b1d0c8974b074a550">HasStorage_</a></td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Class for passing images between producers and consumers. </p>
<p>The <a class="el" href="classflitr_1_1_shared_image_buffer.html" title="Class for passing images between producers and consumers.">SharedImageBuffer</a> class manages the transfer of images between a producer and potentially multiple consumers. A circular (ring) buffer is created where the producer can store images. Consumers can read data as soon as available. Producers reserve available slots in the buffer for writing, while consumers can reserve available buffers for reading. While reserved, the producer can write directly to the buffer and consumers can read from the already written buffers. The structure therefore attempts to minimise copying of image data. Access to the buffer is serialised using mutexes.</p>
<p>A slot contains a single image or a group of images, typically captured at the same time. This allows consumers to obtain a synchronised group of images.</p>
<p>Multiple slots can be reserved for reading and writing. This allows a consumer to e.g. keep access to a range of images if it's interested in a time range (history) of images. </p>
</div><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a7b39011592f16e276f0095fa2e29e24e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SharedImageBuffer::SharedImageBuffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classflitr_1_1_image_producer.html">ImageProducer</a> &amp;&#160;</td>
          <td class="paramname"><em>my_producer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>num_slots</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>images_per_slot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a shared buffer without allocating storage.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">my_producer</td><td>Reference to the producer this buffer is associated with.</td></tr>
    <tr><td class="paramname">num_slots</td><td>The number of slots in the circular buffer.</td></tr>
    <tr><td class="paramname">images_per_slot</td><td>The number of images in a slot (group of synchronised images) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a49353cc6a70e400e0c5a2416797e5cde"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SharedImageBuffer::~SharedImageBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2>Member Function Documentation</h2>
<a class="anchor" id="a8afe882347c328271b6314403bf158dd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedImageBuffer::addConsumer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;&#160;</td>
          <td class="paramname"><em>consumer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Add a new consumer to this buffer. The consumer's read position would be set to the latest image to be written.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">consumer</td><td>Reference to the consumer to be added.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if successfully added. </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a8afe882347c328271b6314403bf158dd_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a8afe882347c328271b6314403bf158dd_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a8afe882347c328271b6314403bf158dd_cgraph" id="classflitr_1_1_shared_image_buffer_a8afe882347c328271b6314403bf158dd_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_image_consumer.html#a4f800e1ab9f514f6a642c4c91165e494" title="Called once we get added as a consumer." alt="" coords="213,5,373,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a786218cf02230d38313d7afd7d40155f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t SharedImageBuffer::getFill </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the space 'filled' in the buffer. </p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a786218cf02230d38313d7afd7d40155f_icgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a786218cf02230d38313d7afd7d40155f_icgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a786218cf02230d38313d7afd7d40155f_icgraph" id="classflitr_1_1_shared_image_buffer_a786218cf02230d38313d7afd7d40155f_icgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a72664737877581da89cda45bbf07956a" title="Returns true if there is no more space in the buffer for writing." alt="" coords="229,5,389,51"/><area shape="rect" id="node7" href="classflitr_1_1_shared_image_buffer.html#a0b7aa2db43f866dd0f24563869a31546" title="flitr::SharedImageBuffer\l::getNumWriteSlotsAvailable" alt="" coords="215,74,404,121"/><area shape="rect" id="node5" href="classflitr_1_1_shared_image_buffer.html#aba78dc0f1a7c2db27351d5d3da7b69b1" title="flitr::SharedImageBuffer\l::reserveWriteSlot" alt="" coords="453,5,613,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a5bed33931d9fd306361f38f8b8827f2b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t SharedImageBuffer::getLeastNumReadSlotsAvailable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Find the least number of readable image slots available between all consumers.</p>
<dl class="section return"><dt>Returns</dt><dd>Least number of read slots available. </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a5bed33931d9fd306361f38f8b8827f2b_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a5bed33931d9fd306361f38f8b8827f2b_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a5bed33931d9fd306361f38f8b8827f2b_cgraph" id="classflitr_1_1_shared_image_buffer_a5bed33931d9fd306361f38f8b8827f2b_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a31fd2907c728e5d5c76de8f116a9b3bc" title="flitr::SharedImageBuffer\l::numAvailable" alt="" coords="277,5,437,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a05fecee04bca209e211d036e493a311c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t SharedImageBuffer::getNumReadSlotsAvailable </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;&#160;</td>
          <td class="paramname"><em>consumer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obtain the number of image slots that are available for reading.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">consumer</td><td>Reference to the consumer for which the query is being made.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of slots available for reading. </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a05fecee04bca209e211d036e493a311c_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a05fecee04bca209e211d036e493a311c_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a05fecee04bca209e211d036e493a311c_cgraph" id="classflitr_1_1_shared_image_buffer_a05fecee04bca209e211d036e493a311c_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a31fd2907c728e5d5c76de8f116a9b3bc" title="flitr::SharedImageBuffer\l::numAvailable" alt="" coords="245,5,405,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ad3d4705f97f0fb770cc6f75bb90eb27a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t SharedImageBuffer::getNumReadSlotsReserved </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;&#160;</td>
          <td class="paramname"><em>consumer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obtain the number of slots that a consumer has reserved for reading but has not yet released.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">consumer</td><td>Reference to the consumer for which the query is being made.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of slots reserved for reading. </dd></dl>

</div>
</div>
<a class="anchor" id="a0b7aa2db43f866dd0f24563869a31546"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t SharedImageBuffer::getNumWriteSlotsAvailable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obtain the number of write slots that can be reserved.</p>
<dl class="section return"><dt>Returns</dt><dd>The number of available write slots. </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a0b7aa2db43f866dd0f24563869a31546_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a0b7aa2db43f866dd0f24563869a31546_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a0b7aa2db43f866dd0f24563869a31546_cgraph" id="classflitr_1_1_shared_image_buffer_a0b7aa2db43f866dd0f24563869a31546_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a786218cf02230d38313d7afd7d40155f" title="Returns the space &#39;filled&#39; in the buffer." alt="" coords="245,5,405,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aa37421f69f9cfa2aff6d656ad7ba0872"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedImageBuffer::initWithoutStorage </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialise the buffer, but do not allocate storage for any images. This is typically used if our elements just point to elements in another shared buffer.</p>
<dl class="section return"><dt>Returns</dt><dd>True on successful initialisation. </dd></dl>

</div>
</div>
<a class="anchor" id="aba6c3ad90a690a4b8228d844777a30cb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedImageBuffer::initWithStorage </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialise the buffer and allocate storage for the images it is to contain.</p>
<dl class="section return"><dt>Returns</dt><dd>True on successful initialisation. </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_aba6c3ad90a690a4b8228d844777a30cb_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_aba6c3ad90a690a4b8228d844777a30cb_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_aba6c3ad90a690a4b8228d844777a30cb_cgraph" id="classflitr_1_1_shared_image_buffer_aba6c3ad90a690a4b8228d844777a30cb_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_image_producer.html#a9495277a8122ec0f7cfb63dc83ceb955" title="flitr::ImageProducer\l::getFormat" alt="" coords="213,5,349,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a72664737877581da89cda45bbf07956a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedImageBuffer::isFull </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns true if there is no more space in the buffer for writing. </p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_cgraph" id="classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a786218cf02230d38313d7afd7d40155f" title="Returns the space &#39;filled&#39; in the buffer." alt="" coords="213,5,373,51"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_icgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_icgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_icgraph" id="classflitr_1_1_shared_image_buffer_a72664737877581da89cda45bbf07956a_icgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#aba78dc0f1a7c2db27351d5d3da7b69b1" title="flitr::SharedImageBuffer\l::reserveWriteSlot" alt="" coords="213,5,373,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a31fd2907c728e5d5c76de8f116a9b3bc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t SharedImageBuffer::numAvailable </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;&#160;</td>
          <td class="paramname"><em>consumer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Utility function to find out how many readable slots exist for a consumer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">consumer</td><td>Consumer to find the number of readable slots for.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of available read slots. </dd></dl>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a31fd2907c728e5d5c76de8f116a9b3bc_icgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a31fd2907c728e5d5c76de8f116a9b3bc_icgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a31fd2907c728e5d5c76de8f116a9b3bc_icgraph" id="classflitr_1_1_shared_image_buffer_a31fd2907c728e5d5c76de8f116a9b3bc_icgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a5bed33931d9fd306361f38f8b8827f2b" title="flitr::SharedImageBuffer\l::getLeastNumReadSlotsAvailable" alt="" coords="215,5,436,51"/><area shape="rect" id="node5" href="classflitr_1_1_shared_image_buffer.html#a05fecee04bca209e211d036e493a311c" title="flitr::SharedImageBuffer\l::getNumReadSlotsAvailable" alt="" coords="231,74,420,121"/><area shape="rect" id="node7" href="classflitr_1_1_shared_image_buffer.html#af51a55ce88130bbb3ba523836fe8b24f" title="flitr::SharedImageBuffer\l::reserveReadSlot" alt="" coords="245,143,405,190"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a7ba7642014e9d00d4529e0c2da41d817"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SharedImageBuffer::releaseReadSlot </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;&#160;</td>
          <td class="paramname"><em>consumer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Indicate that the consumer has finished with a reserved read slot. Should only be called after a slot has been reserved and once for each slot that was reserved.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">consumer</td><td>Reference to the consumer that has completed with a read. </td></tr>
  </table>
  </dd>
</dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_a7ba7642014e9d00d4529e0c2da41d817_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_a7ba7642014e9d00d4529e0c2da41d817_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_a7ba7642014e9d00d4529e0c2da41d817_cgraph" id="classflitr_1_1_shared_image_buffer_a7ba7642014e9d00d4529e0c2da41d817_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#afeaf4dc55a613e16c992947fd5e23e4f" title="flitr::SharedImageBuffer\l::tailPopped" alt="" coords="223,5,383,51"/><area shape="rect" id="node5" href="classflitr_1_1_image_producer.html#a01eb729f570f48453719a037c4dd85d9" title="flitr::ImageProducer\l::releaseReadSlotCallback" alt="" coords="215,74,391,121"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a19244a4980ad7ae90bc173cce849c001"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SharedImageBuffer::releaseWriteSlot </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Indicate that the producer has finished with a reserved write slot. Should only be called after a slot has been reserved and once for each slot that was reserved. </p>

</div>
</div>
<a class="anchor" id="af51a55ce88130bbb3ba523836fe8b24f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; <a class="el" href="classflitr_1_1_image.html">Image</a> ** &gt; SharedImageBuffer::reserveReadSlot </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;&#160;</td>
          <td class="paramname"><em>consumer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reserve (obtain) a slot where image data has already been written. Multiple slots can be reserved before any are released.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">consumer</td><td>Reference to the consumer for which the query is being made.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A vector with pointers to image pointers where data can be read from. The size would match the number of images per slot for this buffer. An empty vector if no slot could be obtained (buffer full or reader busy with all slots). </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_af51a55ce88130bbb3ba523836fe8b24f_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_af51a55ce88130bbb3ba523836fe8b24f_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_af51a55ce88130bbb3ba523836fe8b24f_cgraph" id="classflitr_1_1_shared_image_buffer_af51a55ce88130bbb3ba523836fe8b24f_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a31fd2907c728e5d5c76de8f116a9b3bc" title="flitr::SharedImageBuffer\l::numAvailable" alt="" coords="213,5,373,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aba78dc0f1a7c2db27351d5d3da7b69b1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; <a class="el" href="classflitr_1_1_image.html">Image</a> ** &gt; SharedImageBuffer::reserveWriteSlot </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reserve (obtain) a slot for writing new image data. Multiple slots can be reserved before any are released.</p>
<dl class="section return"><dt>Returns</dt><dd>A vector with pointers to image pointers where data can be written. The size would match the number of images per slot for this buffer. An empty vector if no slot could be obtained (buffer full or readers busy with all slots). </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_aba78dc0f1a7c2db27351d5d3da7b69b1_cgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_aba78dc0f1a7c2db27351d5d3da7b69b1_cgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_aba78dc0f1a7c2db27351d5d3da7b69b1_cgraph" id="classflitr_1_1_shared_image_buffer_aba78dc0f1a7c2db27351d5d3da7b69b1_cgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a72664737877581da89cda45bbf07956a" title="Returns true if there is no more space in the buffer for writing." alt="" coords="213,5,373,51"/><area shape="rect" id="node5" href="classflitr_1_1_shared_image_buffer.html#a786218cf02230d38313d7afd7d40155f" title="Returns the space &#39;filled&#39; in the buffer." alt="" coords="421,5,581,51"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="afeaf4dc55a613e16c992947fd5e23e4f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedImageBuffer::tailPopped </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a> &amp;&#160;</td>
          <td class="paramname"><em>consumer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>See if, after the consumer that just released a slot, all consumers are done with the oldest slot. If we depend on another buffer for our data we can then notify that we are done with the oldest slot.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">consumer</td><td>The consumer that just released a slot.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if all consumers are now done with the oldest used slot. </dd></dl>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classflitr_1_1_shared_image_buffer_afeaf4dc55a613e16c992947fd5e23e4f_icgraph.png" border="0" usemap="#classflitr_1_1_shared_image_buffer_afeaf4dc55a613e16c992947fd5e23e4f_icgraph" alt=""/></div>
<map name="classflitr_1_1_shared_image_buffer_afeaf4dc55a613e16c992947fd5e23e4f_icgraph" id="classflitr_1_1_shared_image_buffer_afeaf4dc55a613e16c992947fd5e23e4f_icgraph">
<area shape="rect" id="node3" href="classflitr_1_1_shared_image_buffer.html#a7ba7642014e9d00d4529e0c2da41d817" title="flitr::SharedImageBuffer\l::releaseReadSlot" alt="" coords="213,5,373,51"/></map>
</div>
</p>

</div>
</div>
<h2>Member Data Documentation</h2>
<a class="anchor" id="a5d6eda5c6b72893dcd44a07f6be46814"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; std::vector&lt; <a class="el" href="classflitr_1_1_image.html">Image</a>* &gt; &gt; flitr::SharedImageBuffer::Buffer_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The actual ring buffer. Contains only pointers. </p>

</div>
</div>
<a class="anchor" id="ad20334fc4ef275986c4e67be4e662ac1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">OpenThreads::Mutex flitr::SharedImageBuffer::BufferMutex_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Protects read and write positions. </p>

</div>
</div>
<a class="anchor" id="a4cf42f427a3eac7b1d0c8974b074a550"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool flitr::SharedImageBuffer::HasStorage_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Indicates whether we have reserved storage for the images in the buffer. </p>

</div>
</div>
<a class="anchor" id="a275b68995a2927046b745c581131f4a5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflitr_1_1_image_producer.html">ImageProducer</a>* flitr::SharedImageBuffer::ImageProducer_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The producer we are a member of. </p>

</div>
</div>
<a class="anchor" id="a7ea53da89e210b91832f1b36bb3c368b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t flitr::SharedImageBuffer::ImagesPerSlot_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Number of images in each slot of the buffer. </p>

</div>
</div>
<a class="anchor" id="a42642938824de5506c0705f73afbfce2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::map&lt; const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a>*, uint32_t &gt; flitr::SharedImageBuffer::NumReadReserved_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Map of consumers to the number of read slots reserved. </p>

</div>
</div>
<a class="anchor" id="aed412326e79260b65385ee085682d9c8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t flitr::SharedImageBuffer::NumSlots_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The number of slots in the buffer. </p>

</div>
</div>
<a class="anchor" id="a3451b7400d02e765fffb3421141360c8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t flitr::SharedImageBuffer::NumWriteReserved_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>How many slots have been reserved for writing. </p>

</div>
</div>
<a class="anchor" id="a1293e90f99e0414ae04baab938532eb5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::map&lt; const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a>*, uint32_t &gt; flitr::SharedImageBuffer::ReadHeads_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Map of consumers to where they are about to read. </p>

</div>
</div>
<a class="anchor" id="a96f00d00633744cab0134509217be32e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::map&lt; const <a class="el" href="classflitr_1_1_image_consumer.html">ImageConsumer</a>*, uint32_t &gt; flitr::SharedImageBuffer::ReadTails_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Map of consumers to one past where they have completed reading. </p>

</div>
</div>
<a class="anchor" id="ae50f18394ddc6e071a0680181a0051d9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t flitr::SharedImageBuffer::WriteHead_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Point where we are about to write. </p>

</div>
</div>
<a class="anchor" id="a00bf09efefa475ac09b8f57585f44d04"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t flitr::SharedImageBuffer::WriteTail_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>One past where we have already written. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/flitr/<a class="el" href="shared__image__buffer_8h_source.html">shared_image_buffer.h</a></li>
<li>src/flitr/<a class="el" href="shared__image__buffer_8cpp.html">shared_image_buffer.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceflitr.html">flitr</a></li><li class="navelem"><a class="el" href="classflitr_1_1_shared_image_buffer.html">SharedImageBuffer</a></li>
    <li class="footer">Generated on Thu Dec 6 2012 09:15:45 for FLITr by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.2 </li>
  </ul>
</div>
</body>
</html>
